<?php
namespace Mobile\Widget;
use Think\Controller;
class TopWidget extends Controller{
	//导航
	public function nav(){
		//导航信息
		$this->top = M('category')->order('sort')->where(array('pid'=>0))->field(array('name','id'))->select();
		$this->display('Top:nav');
	}
	//当前位置
	public function location($data){
		$cid = $data;
		$category = M('category')->select();
		$result = get_all_parent($category,$cid);
		$this->lcid = $cid;
		$this->result = $result;
		$this->display('Top:location');
	}

}